﻿<local:BaseWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:LenovoLegionToolkit.WPF.Windows"
    xmlns:pages="clr-namespace:LenovoLegionToolkit.WPF.Pages"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Title="{x:Static resources:Resource.AppName}"
    Width="1150"
    Height="750"
    MinWidth="650"
    MinHeight="600"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <wpfui:TitleBar Grid.Row="0" />

        <Grid Grid.Row="0" Margin="12,4,150,4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                x:Name="_title"
                Grid.Column="0"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                FlowDirection="LeftToRight"
                FontSize="12"
                IsHitTestVisible="False"
                Text="{x:Static resources:Resource.AppName}" />

            <wpfui:Badge
                x:Name="_openLogIndicator"
                Grid.Column="1"
                Margin="0,0,8,0"
                Padding="8,2,8,2"
                Appearance="Caution"
                Content="Log"
                Cursor="Hand"
                MouseLeftButtonDown="OpenLogIndicator_Click"
                MouseRightButtonDown="OpenLogIndicator_Click"
                Visibility="Collapsed" />

            <wpfui:Badge
                x:Name="_deviceInfoIndicator"
                Grid.Column="2"
                Padding="8,2,8,2"
                Appearance="Transparent"
                Cursor="Hand"
                MouseLeftButtonDown="DeviceInfoIndicator_Click"
                MouseRightButtonDown="DeviceInfoIndicator_Click"
                Visibility="Collapsed" />

        </Grid>

        <Grid
            x:Name="_contentGrid"
            Grid.Row="1"
            Margin="12,6,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <wpfui:NavigationStore
                x:Name="_navigationStore"
                Grid.Column="0"
                Margin="0,0,12,12"
                Frame="{Binding ElementName=_rootFrame}"
                SelectedPageIndex="0">

                <wpfui:NavigationStore.Items>
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Dashboard}"
                        Icon="Home24"
                        PageTag="dashboard"
                        PageType="{x:Type pages:DashboardPage}" />
                    <wpfui:NavigationItem
                        x:Name="_keyboardItem"
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Keyboard}"
                        Icon="Keyboard24"
                        PageTag="keyboardBacklight"
                        PageType="{x:Type pages:KeyboardBacklightPage}" />
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Battery}"
                        Icon="BatteryCheckmark24"
                        PageTag="battery"
                        PageType="{x:Type pages:BatteryPage}" />
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Actions}"
                        Icon="Rocket24"
                        PageTag="automation"
                        PageType="{x:Type pages:AutomationPage}" />
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Packages}"
                        Icon="Box24"
                        PageTag="packages"
                        PageType="{x:Type pages:PackagesPage}" />
                </wpfui:NavigationStore.Items>

                <wpfui:NavigationStore.Footer>
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Settings}"
                        Icon="Settings24"
                        PageTag="settings"
                        PageType="{x:Type pages:SettingsPage}" />
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_Donate}"
                        Icon="Money24"
                        PageTag="donate"
                        PageType="{x:Type pages:DonatePage}" />
                    <wpfui:NavigationItem
                        Content="{x:Static resources:Resource.MainWindow_NavigationItem_About}"
                        Icon="Info24"
                        PageTag="about"
                        PageType="{x:Type pages:AboutPage}" />
                </wpfui:NavigationStore.Footer>

            </wpfui:NavigationStore>

            <Border
                Grid.Column="1"
                Background="{DynamicResource ControlFillColorDefaultBrush}"
                CornerRadius="8,0,0,0">
                <Frame Name="_rootFrame" Margin="24,0,0,0" />
            </Border>

            <wpfui:Snackbar
                x:Name="_snackbar"
                Grid.Column="1"
                MinWidth="300"
                HorizontalAlignment="Center"
                Icon="Checkmark24">
                <StackPanel Margin="4,4,4,4" VerticalAlignment="Center">
                    <!--  ReSharper disable once UnusedMember.Global  -->
                    <TextBlock
                        x:Name="_snackbarTitle"
                        VerticalAlignment="Center"
                        FontSize="16"
                        FontWeight="Medium"
                        Foreground="{DynamicResource TextFillColorPrimaryBrush}"
                        TextWrapping="WrapWithOverflow" />
                    <!--  ReSharper disable once UnusedMember.Global  -->
                    <TextBlock
                        x:Name="_snackbarMessage"
                        Margin="0,6,0,0"
                        FontSize="14"
                        Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                        TextWrapping="WrapWithOverflow" />
                </StackPanel>
            </wpfui:Snackbar>

        </Grid>

        <Label
            x:Name="_updateIndicator"
            Grid.Row="2"
            Padding="8,4,8,4"
            HorizontalContentAlignment="Center"
            Background="{DynamicResource SystemFillColorSuccessBrush}"
            Cursor="Hand"
            Foreground="{DynamicResource TextFillColorPrimaryBrush}"
            MouseLeftButtonDown="UpdateIndicator_Click"
            MouseRightButtonDown="UpdateIndicator_Click"
            Visibility="Collapsed">
            <StackPanel Orientation="Horizontal">
                <wpfui:SymbolIcon Margin="0,0,4,0" Symbol="ArrowSync24" />
                <TextBlock x:Name="_updateIndicatorText" Text="{x:Static resources:Resource.MainWindow_UpdateAvailable}" />
            </StackPanel>
        </Label>

    </Grid>
</local:BaseWindow>
